function ModuleMoveTo(doc, container, width, height, operator, now, options) {
  this._doc = doc;
  this._container = container;
  this._width = width;
  this._height = height;
  this._operator = operator;
  this._now = now;
  this._options = options;
  
  this._dirId = [];
  this._doc._func = [];
  
  this._callbackFunc = (options && options.callbackFunc) ? options.callbackFunc : null;
  this._popupBox = (options && options.popupBox) ? options.popupBox : null;
  this._items= (options && options.selected) ? options.selected : null;
  
  this._dirId[0] = (options && options.d) ? options.d : 0;

  this._createElements();
}

ModuleMoveTo.prototype._createElements = function() {
  this._gui = new MoveTo(this._doc, this._container, this._width, this._height, this._operator, this._now, this._options)._gui;
  var _self = this, tr, td;
  
  DOMUtils.removeChildElements(this._gui.files);

  /*-选中文件列表-*/
  var iframe = this._doc.createElement('iframe');
  iframe.id = 'frame1';
  iframe.width = '100%';
  iframe.style.height = '80px';
  iframe.frameBorder = 0;
  iframe.style.overflowX = 'hidden';
  iframe.style.overflowY = 'auto';
  iframe.src = '?b=baseblank&t=file&opts=' + MiscUtils.encode({ items: this._items });
  this._gui.files.appendChild(iframe);
  
  this._loadData();
};

ModuleMoveTo.prototype._loadData = function() {
  this._parents = null;
  this._retrieveParents();
};

ModuleMoveTo.prototype._verifyData = function() {
  if (this._parents) {
    this._updateElements();
  }
};

ModuleMoveTo.prototype._retrieveParents = function() {
  var _self = this;
  new RequestUtils()._custom('retrieveFileRoot', { dirId: this._dirId[this._dirId.length-1], customerTrackId: this._operator.trackId }, function(result, params) { _self._parents = result;
                                                                                                                                                                             _self._verifyData.call(_self);
                                                                                                                                                                           }, null);
};

ModuleMoveTo.prototype._updateElements = function() {
  var _self = this, tr1, td1;
  DOMUtils.removeChildElements(this._gui.panel);
  DOMUtils.removeChildElements(this._gui.path);
  
  /*-文件夹排列显示-*/
  var f = function(dirId) { _self._dirId[_self._dirId.length] = dirId;
                            _self._retrieveParents();
                          };
  this._doc._func[0] = f;
  
  var iframe = this._doc.createElement('iframe');
  iframe.id = 'frame2';
  iframe.style.width = '100%';
  iframe.style.height = '150px';
  iframe.frameBorder = 0;
  iframe.style.overflowX = 'hidden';
  iframe.style.overflowY = 'auto';
  iframe.src = '?b=baseblank&t=directorysimple&opts=' + MiscUtils.encode({ d: this._dirId[this._dirId.length-1], items: this._items });
  this._gui.panel.appendChild(iframe);
  
  /*-路径显示-*/
  var table = this._doc.createElement('table');
  table.style.width = '344px';
  table.style.height = '24px';
  table.cellPadding = 0;
  table.cellSpacing = 0;
  this._gui.path.appendChild(table);
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.width = '70px';
  td.align = 'center';
  td.style.verticalAlign = 'middle';
  var home = this._doc.createElement('img');
  home.src = 'image/copy/home.png';
  home.style.cursor='pointer';
  home.onclick = function() { _self._dirId[_self._dirId.length] = 0;
                              _self._retrieveParents();
                            }
  td.appendChild(home);
  
  td = tr.insertCell(-1);
  td.style.width = '274px';
  td.align = 'left';
  var navitable = this._doc.createElement('table');
  navitable.style.width = '274px';
  navitable.style.height = '24px';
  navitable.cellPadding = 0;
  navitable.cellSpacing = 0;
  td.appendChild(navitable);

  ntr = navitable.insertRow(-1);
  if (this._parents.length >= 4) {
    ntd = ntr.insertCell(-1);
    ntd.align = 'left';
    var table1 = this._doc.createElement('table');
    table1.cellPadding = 0;
    table1.cellSpacing = 0;
    table1.style.width = '50px';
    ntd.appendChild(table1);
    tr1 = table1.insertRow(-1);
    td1 = tr1.insertCell(-1);
    td1.style.width = '9px';
    td1.align = 'left';
    td1.style.verticalAlign = 'middle';
    var narrow = this._doc.createElement('img');
    narrow.src = 'image/copy/right.png';
    td1.appendChild(narrow);
    td1 = tr1.insertCell(-1);
    td1.style.width = '41px';
    td1.align = 'center';
    td1.style.verticalAlign = 'middle';
    td1.appendChild(this._doc.createTextNode('......'));
    for(var i = 2, il = 0; i >= il; i--) {
      var parent = this._parents[i];
      ntd = ntr.insertCell(-1);
      ntd.align = 'left';
      var table1 = this._doc.createElement('table');
      table1.cellPadding = 0;
      table1.cellSpacing = 0;
      table1.style.width = '55px';
      ntd.appendChild(table1);
      tr1 = table1.insertRow(-1);
      td1 = tr1.insertCell(-1);
      td1.style.width = '9px';
      td1.align = 'left';
      td1.style.verticalAlign = 'middle';
      var narrow = this._doc.createElement('img');
      narrow.src = 'image/copy/right.png';
      td1.appendChild(narrow);
      td1 = tr1.insertCell(-1);
      td1.style.width = '46px';
      td1.align = 'center';
      td1.style.verticalAlign = 'middle';
      var a = this._doc.createElement('a');
      a.href = '#';
      a._parent = parent;
      if (i != 0) {
        a.appendChild(this._doc.createTextNode(NPFileUtils.cutStr(parent.name, 6)));
        a.onclick = function() { _self._dirId[_self._dirId.length] = this._parent.dirId;
                                 _self._retrieveParents();
                               };
        td1.appendChild(a);
      } else {
        td1.appendChild(this._doc.createTextNode(NPFileUtils.cutStr(parent.name, 6)));
      }
    }
  } else {
    for(var i = this._parents.length-1, il = 0; i >= il; i--) {
      var parent = this._parents[i];
      ntd = ntr.insertCell(-1);
      ntd.align = 'left';
      var table1 = this._doc.createElement('table');
      table1.cellPadding = 0;
      table1.cellSpacing = 0;
      table1.style.width = '55px';
      ntd.appendChild(table1);
      tr1 = table1.insertRow(-1);
      td1 = tr1.insertCell(-1);
      td1.style.width = '9px';
      td1.align = 'left';
      td1.style.verticalAlign = 'middle';
      var narrow = this._doc.createElement('img');
      narrow.src = 'image/copy/right.png';
      td1.appendChild(narrow);
      td1 = tr1.insertCell(-1);
      td1.style.width = '46px';
      td1.align = 'center';
      td1.style.verticalAlign = 'middle';
      if (i != il) {
        var a = this._doc.createElement('a');
        a.href = '#';
        a._parent = parent;
        a.appendChild(this._doc.createTextNode(NPFileUtils.cutStr(parent.name, 6)));
        a.onclick = function() { _self._dirId[_self._dirId.length] = this._parent.dirId;
                                 _self._retrieveParents();
                               };
        td1.appendChild(a);
      } else {
        td1.appendChild(this._doc.createTextNode(NPFileUtils.cutStr(parent.name, 6)));
      }
    }
  }
  ntd = ntr.insertCell(-1);
  ntd.style.width = '300px';

  /*-返回按钮-*/
  this._gui.back.style.display = (this._dirId[this._dirId.length-1]) ? 'block' : 'none';
  this._gui.back.onclick = function() { new RequestUtils()._read('file', null, 'd.dirId=\'' + _self._dirId[_self._dirId.length-1] + '\'' + ' AND d.customerTrackId=\'' + _self._operator.trackId + '\'', null, null, null, null, function(result, params) { if (result.data.length != 0) {
                                                                                                                                                                                                                                                              _self._dirId[_self._dirId.length] = (result.data[0].parentDirId != 0) ? result.data[0].parentDirId : 0;
                                                                                                                                                                                                                                                              _self._retrieveParents.call(_self);
                                                                                                                                                                                                                                                            }
                                                                                                                                                                                                                                                          }, null);
                                      };
  /*-确认/取消移动操作-*/
  this._gui.ok.onclick = function() { var files = [];
                                      for (var i = 0, il = _self._items.length; i < il; i++) {
                                        var item = _self._items[i];
                                        item.parentDirId = _self._dirId[_self._dirId.length-1];
                                        files[files.length] = item;
                                      }
                                      new RequestUtils()._write('file', files, [], function() { _self._popupBox._close(); _self._callbackFunc(); }, { pos: DOMUtils.findPos(this), doc: _self._doc });
                                    };
  this._gui.cancel.onclick = function() { _self._popupBox._close(); };
};
